package com.qing.config.security.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qing.config.security.pojo.Users;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author qinghua
 * @date 2022/5/31 14:17
 */
@Mapper
public interface UsersMapper extends BaseMapper<Users> {

    @Select("select id, username, password, status from user where username = #{username}")
    Users login(@Param("username") String username);

    @Select("SELECT 1 FROM `user` WHERE username = #{username} AND deleted = 0")
    Integer queryExist(@Param("username") String username);

}
